package cell;

import java.awt.Graphics;
import java.awt.Image;
import java.awt.Toolkit;
import java.awt.image.ImageObserver;
 
public class Cell {
	private boolean alive = false;
	static Image image;
	static
	{
		image = Toolkit.getDefaultToolkit().getImage("grass.jpg");
	}
	
	public Cell() {
		
	}
	public void die() { alive = false; }
	public void reborn() { alive = true; }
	public boolean isAlive() { return alive; }
	
	public void draw(Graphics g, int x, int y, int size, ImageObserver observer) {
		g.drawRect(x, y, size, size);
		if ( alive ) {
			g.drawImage(image, x, y, size, size, observer);
		}
	}
}
